package org.nlp2rdf.navigator.component.store;

import java.util.List;

import org.nlp2rdf.navigator.client.common.ConceptDTO;
import org.nlp2rdf.navigator.client.common.LearnedConceptDTO;
import org.nlp2rdf.navigator.client.common.RelatedConceptsDTO;
import org.nlp2rdf.navigator.client.common.StoredConceptDTO;
import org.nlp2rdf.navigator.component.IComponent;
import org.nlp2rdf.navigator.component.exception.ConceptSavingFailedException;

/**
 * A store serves two purposes here: 1. store LearningResultDTO objects 2.
 * output related concepts based on the stored concepts
 * 
 * @author Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
 * 
 */
public interface IStore extends IComponent {

	/**
	 * save the given object persistently also needs to update any methods that
	 * calculate related concepts, such as the reasoner
	 * 
	 * @param learningResultDTO
	 */
	public StoredConceptDTO saveConcept(LearnedConceptDTO learningResultDTO) throws ConceptSavingFailedException;

	/**
	 * TODO order by certain features
	 * 
	 * @return a list of all concepts
	 */
	public List<StoredConceptDTO> getStoredConcepts();

	public void incrementHitCount(StoredConceptDTO learningResultDTO);

	/**
	 * Relatedness can be defined in arbitrary ways e.g. string similarity and
	 * depends upon the configuration
	 * 
	 * @param learningresultDTO
	 * @return
	 */
	public RelatedConceptsDTO getRelatedConcepts(ConceptDTO learningresultDTO);

}
